//
//  ExperimentModel.m
//  autostainer
//
//  Created by lurenjia on 2017/5/16.
//  Copyright © 2017年 walker. All rights reserved.
//

#import "ExperimentModel.h"

@implementation ExperimentModel
- (instancetype)initWithDict:(NSDictionary *)dict {
    if (self = [super init]) {
        [self setValuesForKeysWithDictionary:dict];
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {}

- (NSString *)time {
    if (!_timeModel) {
        return _time;
    }
    else {
        NSMutableString *time = [NSMutableString string];
        if (_timeModel.hour !=0) {
            time = [NSMutableString stringWithFormat:@"%.0f小时",_timeModel.hour];
        }
        if (_timeModel.minute != 0) {
            [time appendString:[NSString stringWithFormat:@"%.0f分",_timeModel.minute]];
        }
        if (_timeModel.second != 0) {
            [time appendString:[NSString stringWithFormat:@"%.0f秒",_timeModel.second]];
        }
        return time;
    }
    
}
@end
